package OperationSystem.day1205File;

import java.io.File;
import java.util.Scanner;

public class DeleteFile {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        File file = new File("这是一个file对象.txt");
        System.out.println("file文件创建成功");

        scanner.nextLine();
        file.delete();      //立即删除
        //file.deleteOnExit();  JVM退出时删除
        System.out.println("文件删除成功");
        scanner.nextLine();
    }
}
